class Goods:              # 定义goods类
    def __init__(self, name, price):            # 初始化对象属性
        self.name = name
        self.price = price

    def info(self):                             # 为对象设置方法
        print(f'名字：{self.name}, 单价：{self.price}')



class Phone(Goods):                              # 定义phone类
    def __init__(self, name, price, brand, os):  # 初始化对象属性

        super().__init__(name, price)            # 调用父类的__init__方法
        self.brand = brand
        self.os = os

    def info(self):
        super().info()
        print(self.brand)
        print(self.os)


p1 = Phone('iPhone13', 1999, 'apple', 'ios')
p1.info()
















